<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>分公司采购退货管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 
  <link rel="stylesheet" href="../../res/css/wholesale/font.css">
  <link rel="stylesheet" href="../../res/css/wholesale/xadmin.css">
  <link rel="stylesheet" href="../../res/layui/css/layui.css">
  <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script type="text/javascript" src="../../res/layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="../../res/js/wholesale/xadmin.js"></script>
  <script type="text/javascript" src="../../res/js/return/return.js"></script>
</head>
<body>
<div class="demoTable" style="margin-top: 10px;">
    <div class="x-body">
      <div class="layui-row">
        <div class="layui-form layui-col-md12 x-so">
          <input type="text" name="sellId" id="sellId" placeholder="订单号查询" autocomplete="off" class="layui-input">
          <button class="layui-btn" data-type="reload" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </div>
      </div>
<table class="layui-table" lay-data="{url:'../../listenReturnGoods/selectReturn.action', page:true, id:'idTest'}" lay-filter="demo">
  <thead>
    <tr>
      <th lay-data="{field:'sellTime',align:'center' , templet: '#operationTime'}">采购时间</th>
      <th lay-data="{field:'sellPrice', align:'center'}">采购金额</th>
      <th lay-data="{field:'sellNumber',align:'center'}">采购数量</th>
      <th lay-data="{field:'companyName', align:'center'}">采购对象</th>
      <th lay-data="{field: 'right', align:'center', fixed: 'right', toolbar: '#barDemo'}">操作</th>
    </tr>
  </thead>                                      
</table>
 </div>
 </div>
<script src="../../res/js/wj/common.js" charset="utf-8"></script>
<script type="text/html" id="barDemo">
{{ showBtn(d)}}
  
</script>
<script type="text/javascript">
	function showBtn(d){
		var html = "";
		if(d.returnState==1){
			html='<a class="layui-btn layui-btn-xs layui-btn-disabled">已退货</a><a class="layui-btn layui-btn-xs" lay-event="detail">查看明细详情</a>'
		}else{
			html='<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="return">退货</a><a class="layui-btn layui-btn-xs" lay-event="detail">查看明细详情</a>'
		}
		return html;
	}
</script>
<script type="text/html" id="operationTime">
  {{ formatDate(d.sellTime) }}  
</script>
</body>
</html>